import Vue from "vue";
import VueRouter from "vue-router";
import routes from "./routes.js";
import { setPageTitle } from "../utils/setTitle.js";

if(!window.VurRouter){
    Vue.use(VueRouter);
}

const router = new VueRouter({
    mode: "history",
    routes
});

router.afterEach((to)=>{
    setPageTitle(to.meta.title);
});

export default router;
